package com.itheima.homework;

import java.util.Random;

public class Demo8 {
    public static void main(String[] args) {
        int[] arr = {2,588,888,1000,10000};
        chou(arr);
    }
    public static void chou(int[] arr){
        Random r=new Random();

        int count = 0;
        while(true){
            int index = r.nextInt(arr.length);
                if(arr[index] != 0){
                    System.out.println(arr[index]+"元的奖金被抽出");
                    arr[index] = 0;
                    count++;
                }
                if(count == arr.length){
                    return;
                }

            }
        }
    }


